var rp = require('request-promise');

const initOptions = {
    headers: {
        authorization: ""
    },
    json: true
}

module.exports = {
    setToken: token => initOptions.headers["authorization"] = token,
    async request(option) {
        return await rp({
            ...initOptions,
            ...option
        });
    }
}